<template>
	<view>
		<view class="padding solid-bottom flex align-center" style="width: 100%;" v-for="(item,index) in details" :key="index">
			<view>
				<image style="width: 50px !important;height: 50px;object-fit: cover;" mode="aspectFill" :src="item.img"></image>
			</view>
			<view class="padding-left">
				<view style="display: block;">{{item.name}}</view>
				<view class="text-sm text-gray padding-top-xs padding-bottom-xs">{{item.attrName}}</view>
				<view class="flex justify-between text-gray text-sm">
					<text>数量 ：{{item.num}}</text>
					<text @tap="clickComment(item)" class="cu-tag round bg-white line-brown" v-if="item.commented">评价</text>
					<text class="text-grey" v-else>已评价</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				details:[],
				orderno:''
			}
		},onLoad(options) {
			this.orderno = options.orderno;
		},onShow() {
			this.$get('mall/order/detail', {
				orderno: this.orderno
			}).then((res) => {
				if (res.data) {
					this.details = res.data.details;
				}
			})
		},methods:{
			clickComment(item) {
				uni.setStorage({
					key:'commentSku',
					data:item,
					success() {
						uni.navigateTo({
							url:'/pages/order/commentadd'
						})
					}
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}
</style>
